{include file="public/header" /}

<div class="page">
    <form id="user_form" enctype="multipart/form-data" method="post">
        <input type="hidden" name="member_id" value="{$member_array.member_id}" />
        <input type="hidden" name="old_member_avatar" value="{$member_array.member_avatar}" />
        <input type="hidden" name="member_name" value="{$member_array.member_name}" />
        <table class="ds-default-table">
            <tbody>
                <tr class="noborder">
                    <td class="required w120"><label>{$Think.lang.ds_member_name}:</label></td>
                    <td class="vatop rowform">{$member_array.member_name}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label for="member_password">{$Think.lang.ds_member_password}:</label></td>
                    <td class="vatop rowform"><input type="text" id="member_password" name="member_password" class="txt"></td>
                    <td class="vatop tips">{$Think.lang.member_edit_password_keep}</td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label for="member_paypwd">{$Think.lang.member_edit_paypwd}:</label></td>
                    <td class="vatop rowform"><input type="text" id="member_paypwd" name="member_paypwd" class="txt"></td>
                    <td class="vatop tips">{$Think.lang.member_edit_password_keep}</td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label for="member_email">{$Think.lang.member_email}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$member_array.member_email}" id="member_email" name="member_email" class="txt"></td>
                    <td class="vatop tips">{$Think.lang.member_email}</td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label for="member_truename">{$Think.lang.member_truename}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$member_array.member_truename}" id="member_truename" name="member_truename" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_edit_sex}:</label></td>
                    <td class="vatop rowform">
                        <label class="radio-label">
                            <i  class="radio-common {if $member_array.member_sex == 0}selected{/if}">
                                <input type="radio" value="0" name="member_sex" {if $member_array.member_sex == 0}checked="checked"{/if}>
                            </i>
                            <span>{$Think.lang.member_edit_secret}</span>
                        </label>
                        <label class="radio-label">
                            <i  class="radio-common {if $member_array.member_sex == 1}selected{/if}">
                                <input type="radio" value="1" name="member_sex" {if $member_array.member_sex == 1}checked="checked"{/if}>
                            </i>
                            <span>{$Think.lang.member_edit_male}</span>
                        </label>
                        <label class="radio-label">
                            <i  class="radio-common {if $member_array.member_sex == 2}selected{/if}">
                                <input type="radio" value="2" name="member_sex" {if $member_array.member_sex == 2}checked="checked"{/if}>
                            </i>
                            <span>{$Think.lang.member_edit_female}</span>
                        </label>
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label class="member_areainfo">{$Think.lang.member_areainfo}:</label></td>
                    <td class="vatop rowform"  colspan="2">
                        <span  class="w400">
                      <input type="hidden" value="{$member_array['member_provinceid']|default=''}" name="province_id" id="_area_1">
                      <input type="hidden" value="{$member_array['member_cityid']|default=''}" name="city_id" id="_area_2">
                      <input type="hidden" value="{$member_array['member_areaid']|default=''}" name="area_id" id="_area_3">
                      <input type="hidden" name="region" id="region" value="{$member_array.member_areainfo}"/>
                        </span>
                    </td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label class="member_mobile">{$Think.lang.member_mobile}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$member_array.member_mobile}" id="member_mobile" name="member_mobile" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label class="member_qq">QQ:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$member_array.member_qq}" id="member_qq" name="member_qq" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label class="member_ww">{$Think.lang.member_ww}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$member_array.member_ww}" id="member_ww" name="member_ww" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_auth}:</label></td>
                    <td class="vatop rowform">
                        <label class="radio-label">
                            <i  class="radio-common {if $member_array.member_auth_state != 3}selected{/if}">
                                <input type="radio" value="{if $member_array.member_auth_state == 3}0{else}{$member_array.member_auth_state}{/if}" name="member_auth_state" {if $member_array.member_auth_state != 3}checked="checked"{/if}>
                            </i>
                            <span>{$Think.lang.member_auth_state0}</span>
                        </label>
                        <label class="radio-label">
                            <i  class="radio-common {if $member_array.member_auth_state == 3}selected{/if}">
                                <input type="radio" value="3" name="member_auth_state" {if $member_array.member_auth_state == 3}checked="checked"{/if}>
                            </i>
                            <span>{$Think.lang.member_auth_state3}</span>
                        </label>
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_index_inform}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="inform_allow1" class="cb-enable {if $member_array.inform_allow == '1'}selected{/if}" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="inform_allow2" class="cb-disable {if $member_array.inform_allow == '2'}selected{/if}" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="inform_allow1" name="inform_allow" {if $member_array.inform_allow == '1'}checked="checked"{/if}  value="1" type="radio">
                        <input id="inform_allow2" name="inform_allow" {if $member_array.inform_allow == '2'}checked="checked"{/if} value="2" type="radio">
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_edit_allowbuy}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="isbuy_1" class="cb-enable {if $member_array.is_buylimit == '1'}selected{/if}" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="isbuy_2" class="cb-disable {if $member_array.is_buylimit == '0'}selected{/if}" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="isbuy_1" name="isbuy" {if $member_array.is_buylimit == '1'}checked="checked"{/if}  value="1" type="radio">
                        <input id="isbuy_2" name="isbuy" {if $member_array.is_buylimit == '0'}checked="checked"{/if} value="0" type="radio">
                    </td>
                    <td class="vatop tips">{$Think.lang.member_edit_allowbuy_tip}</td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_edit_allowtalk}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="allowtalk_1" class="cb-enable {if $member_array.is_allowtalk == '1'}selected{/if}" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="allowtalk_2" class="cb-disable {if $member_array.is_allowtalk == '0'}selected{/if}" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="allowtalk_1" name="allowtalk" {if $member_array.is_allowtalk == '1'}checked="checked"{/if}  value="1" type="radio">
                               <input id="allowtalk_2" name="allowtalk" {if $member_array.is_allowtalk == '0'}checked="checked"{/if} value="0" type="radio">
                    </td>
                    <td class="vatop tips">{$Think.lang.member_edit_allowtalk_tip}</td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_edit_allowlogin}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="memberstate_1" class="cb-enable {if $member_array.member_state == '1'}selected{/if}" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="memberstate_2" class="cb-disable {if $member_array.member_state == '0'}selected{/if}" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="memberstate_1" name="member_state" {if $member_array.member_state == '1'}checked="checked"{/if}  value="1" type="radio">
                        <input id="memberstate_2" name="member_state" {if $member_array.member_state == '0'}checked="checked"{/if}  value="0" type="radio">
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_mobilebind}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="membermobilebind_1" class="cb-enable {if $member_array.member_mobilebind == '1'}selected{/if}" ><span>{$Think.lang.ds_verified}</span></label>
                        <label for="membermobilebind_2" class="cb-disable {if $member_array.member_mobilebind == '0'}selected{/if}" ><span>{$Think.lang.ds_unverified}</span></label>
                        <input id="membermobilebind_1" name="member_mobilebind" {if $member_array.member_mobilebind == '1'}checked="checked"{/if}  value="1" type="radio">
                        <input id="membermobilebind_2" name="member_mobilebind" {if $member_array.member_mobilebind == '0'}checked="checked"{/if} value="0" type="radio">
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_emailbind}:</label></td>
                    <td class="vatop rowform onoff">
                        <label for="memberemailbind_1" class="cb-enable  {if $member_array.member_emailbind == '1'}selected{/if}" ><span>{$Think.lang.ds_verified}</span></label>
                        <label for="memberemailbind_2" class="cb-disable {if $member_array.member_emailbind == '0'}selected{/if}" ><span>{$Think.lang.ds_unverified}</span></label>
                        <input id="memberemailbind_1" name="member_emailbind" {if $member_array.member_emailbind == '1'}checked="checked"{/if} value="1" type="radio">
                        <input id="memberemailbind_2" name="member_emailbind" {if $member_array.member_emailbind == '0'}checked="checked"{/if} value="0" type="radio"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.ds_member_points}:</label></td>
                    <td class="vatop rowform">{$Think.lang.ds_member_points}&nbsp;<strong class="red">{$member_array.member_points}</strong>&nbsp;{$Think.lang.ds_member_points}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_exppoints}:</label></td>
                    <td class="vatop rowform">{$Think.lang.member_exppoints}&nbsp;<strong class="red">{$member_array.member_exppoints}</strong>&nbsp;{$Think.lang.ds_member_points}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_index_available}{$Think.lang.ds_predeposit}:</label></td>
                    <td class="vatop rowform">{$Think.lang.member_index_available}&nbsp;<strong class="red">{$member_array.available_predeposit}</strong>&nbsp;{$Think.lang.ds_yuan}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required"><label>{$Think.lang.member_index_frozen}{$Think.lang.ds_predeposit}:</label></td>
                    <td class="vatop rowform">{$Think.lang.member_index_frozen}&nbsp;<strong class="red">{$member_array.freeze_predeposit}</strong>&nbsp;{$Think.lang.ds_yuan}</td>
                    <td class="vatop tips"></td>
                </tr>
            </tbody>
            <tfoot>
                <tr class="tfoot">
                    <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
                </tr>
            </tfoot>
        </table>
    </form>

    <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function() {
            $("#region").ds_region();
            $('#user_form').validate({
                errorPlacement: function(error, element) {
                    error.appendTo(element.parent().parent().find('td:last'));
                },
                rules: {
                    member_password: {
                        maxlength: 20,
                        minlength: 6
                    },
                    member_email: {
                        email: true,
                        remote: {
                            url: ADMINSITEURL+'/Member/ajax.html?branch=check_email',
                            type: 'get',
                            data: {
                                user_name: function() {
                                    return $('#member_email').val();
                                },
                                member_id : '{$member_array.member_id}'
                            }
                        }
                    }
                },
                messages: {
                    member_password: {
                        maxlength: '{$Think.lang.member_edit_password_tip}',
                        minlength: '{$Think.lang.member_edit_password_tip}'
                    },
                    member_email: {
                        email: '{$Think.lang.member_edit_valid_email}',
                        remote: '{$Think.lang.member_edit_email_exists}'
                    }
                }
            });
        });
    </script> 
</div>    
